<template>
  <div class="newsong_content">
    <div class="newsong_item" v-for="(item, index) in musicList" :key="index" @dblclick="playMusic(index)">
      <div class="newsong_item_index">
        <span v-show="!(playId == 'no-id' && index == playIndex && item.name == playName)">{{ index + 1 }}</span>
        <i class="iconfont icon-V" v-show="playId == 'no-id' && index == playIndex && item.name == playName"></i>
      </div>
      <div class="newsong_item_img">
        <img :src="item.picUrl" />
        <div class="icon">
          <i class="iconfont icon-bofang"></i>
        </div>
      </div>
      <div class="newsong_item_name">
        <span>{{ item.name }}</span>
        <span>{{ item.song.album.company }}</span>
      </div>
    </div>
  </div>
</template>

<script>
import { playMusic } from '../../../mixin/global/play-music'
import { imgLoadMixin } from '../../../mixin/global/imgLoad'
import { playing } from '../../../player/playing'
export default {
  name: 'Newsong',
  props: {
    musicList: {
      type: Array,
      default: () => []
    }
  },
  data() {
    return {
      isVolume: 0 // 显示音量图标
    }
  },
  mixins: [playMusic, imgLoadMixin, playing]
}
</script>

<style lang="less" scoped>
.newsong_content {
  padding: 10px;
  border-top: 1px solid rgb(83, 80, 80);
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  .newsong_item {
    display: flex;
    padding-bottom: 20px;
    width: 50%;
    cursor: pointer;
    .newsong_item_index {
      width: 12%;
      display: flex;
      justify-content: center;
      align-items: center;
      i {
        color: #2d8cf0;
      }
    }
    .newsong_item_img {
      width: 16%;
      position: relative;
      img {
        width: 100%;
      }
      .icon {
        // background: rgba(00, 0, 0, 0.3);
        border-radius: 50%;
        width: 24px;
        height: 24px;
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        i {
          color: #fff;
          font-size: 24px;
        }
      }
    }
    .newsong_item_name {
      width: 72%;
      padding: 8px 0 8px 14px;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      span {
        font-size: 14px;
      }
    }
  }
}
</style>
